package com.example.demo.service;




import com.example.demo.bean.User;
import com.example.demo.Dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service //将类交由spring管理
public class userService  {
     //注入userDao对
    @Autowired
     private UserDao userDao ;

    public  int Updateuser(String username, String password ,int role){
        userDao.Updateuser(username,password,role);
    return 1;
}
    public int Deleteuser( String username){

                userDao.Deleteuser(username);return 1;
    }

    public User selectsUser(String username, String password){

        return userDao.selectsUser(username, password);
    }
        public List<User> selectUser(){
            return userDao.selectUser();
         }
        public void InsertUser(String username, String password) {

        userDao.InsertUser(username, password);
        }

}



